//
//  BKCollectionView.m
//  bestkeep
//
//  Created by utouu666 on 17/2/16.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BKCollectionView.h"

@interface BKCollectionView()

@property (copy, nonatomic) BKScrollViewShouldBeginPanGestureHandler gestureBeginHandler;

@end

@implementation BKCollectionView

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
    if (_gestureBeginHandler && gestureRecognizer == self.panGestureRecognizer) {
        return _gestureBeginHandler(self, (UIPanGestureRecognizer *)gestureRecognizer);
    }
    else {
        return [super gestureRecognizerShouldBegin:gestureRecognizer];
    }
}

- (void)setupScrollViewShouldBeginPanGestureHandler:(BKScrollViewShouldBeginPanGestureHandler)gestureBeginHandler {
    _gestureBeginHandler = [gestureBeginHandler copy];
}


@end
